//---------------------------------------------------------------------------

#ifndef adminUnitH
#define adminUnitH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.DBGrids.hpp>
#include <Vcl.Grids.hpp>
#include <Vcl.ButtonGroup.hpp>
#include <Vcl.CategoryButtons.hpp>
#include <Vcl.ComCtrls.hpp>
#include <Vcl.Menus.hpp>
#include <Vcl.Buttons.hpp>
#include <Vcl.DBCtrls.hpp>
#include <Vcl.Samples.Spin.hpp>
#include <Vcl.CheckLst.hpp>
#include <Vcl.ImgList.hpp>
//---------------------------------------------------------------------------
class TadminForm : public TForm
{
__published:	// IDE-managed Components
	TButton *Button7;
	TMainMenu *MainMenu1;
	TMenuItem *N1;
	TMenuItem *N2;
	TPageControl *PageControl1;
	TTabSheet *TabSheet2;
	TTabSheet *TabSheet3;
	TTabSheet *TabSheet4;
	TTabSheet *TabSheet5;
	TDBGrid *specsGrid;
	TDBGrid *predmetsGrid;
	TDBGrid *groupsGrid;
	TDBGrid *prepodsGrid;
	TGroupBox *GroupBox2;
	TLabel *Label2;
	TLabel *Label3;
	TEdit *specs_title_edit;
	TEdit *specs_short_title_edit;
	TButton *add_specs_button;
	TComboBox *study_types_ComboBox;
	TLabel *Label21;
	TMenuItem *N3;
	TMenuItem *N4;
	TMenuItem *N5;
	TGroupBox *GroupBox5;
	TLabel *Label10;
	TLabel *Label11;
	TLabel *Label12;
	TLabel *Label13;
	TEdit *prepod_surname_edit;
	TEdit *prepod_name_edit;
	TEdit *prepod_fathername_edit;
	TEdit *prepod_login_edit;
	TButton *add_prepod_button;
	TGroupBox *GroupBox3;
	TLabel *Label4;
	TLabel *Label5;
	TLabel *Label6;
	TEdit *predmet_title_edit;
	TButton *add_predmet_button;
	TComboBox *spec_for_predmet_combo;
	TSpinEdit *term_spin_edit;
	TGroupBox *GroupBox1;
	TLabel *Label1;
	TLabel *Label14;
	TLabel *Label15;
	TEdit *student_surname_edit;
	TEdit *student_name_edit;
	TEdit *student_fathername_edit;
	TButton *add_student_button;
	TImageList *ImageList16;
	TImageList *ImageList24;
	TEdit *prepod_password_edit;
	TLabel *Label17;
	TLabel *Label7;
	TComboBox *ved_prepod_combo;
	TLabel *Label16;
	TEdit *student_begin_year_edit;
	TLabel *Label18;
	TEdit *student_end_year_edit;
	TMenuItem *N7;
	TMenuItem *N8;
	TMenuItem *N9;
	TMenuItem *N10;
	TTabSheet *TabSheet1;
	TDBGrid *DBGrid1;
	TGroupBox *GroupBox4;
	TLabel *Label19;
	TComboBox *spec_for_group_combo;
	TLabel *Label20;
	TEdit *group_name_edit;
	TButton *add_group_button;
	TLabel *Label9;
	TComboBox *student_group_combo;
	TLabel *Label8;
	TButton *delete_prepod_button;
	TButton *delete_specs_button;
	TButton *delete_predmet_button;
	TButton *delete_group_button;
	TSpinEdit *course_spin_edit;
	TButton *delete_student_button;
	void __fastcall add_specs_buttonClick(TObject *Sender);
	void __fastcall N8Click(TObject *Sender);
	void __fastcall study_types_ComboBoxChange(TObject *Sender);
	void __fastcall add_prepod_buttonClick(TObject *Sender);
	void __fastcall add_predmet_buttonClick(TObject *Sender);
	void __fastcall add_group_buttonClick(TObject *Sender);
	void __fastcall add_student_buttonClick(TObject *Sender);
	void __fastcall student_group_comboChange(TObject *Sender);
	void __fastcall delete_prepod_buttonClick(TObject *Sender);
	void __fastcall delete_specs_buttonClick(TObject *Sender);
	void __fastcall delete_predmet_buttonClick(TObject *Sender);
	void __fastcall N4Click(TObject *Sender);
	void __fastcall PageControl1Changing(TObject *Sender, bool &AllowChange);
	void __fastcall spec_for_predmet_comboChange(TObject *Sender);
	void __fastcall spec_for_group_comboChange(TObject *Sender);
	void __fastcall course_spin_editChange(TObject *Sender);
	void __fastcall delete_group_buttonClick(TObject *Sender);
	void __fastcall delete_student_buttonClick(TObject *Sender);



private:	// User declarations
TStringList *id_specs;
TStringList *id_groups;
TStringList *id_prepods;
TStringList *course_list;
int id_prepod;
int id_spec;
int id_group;
int id_student;
int id_predmet;

bool spec_edit_flag;
bool prepod_edit_flag;
bool predmet_edit_flag;
bool group_edit_flag;
bool student_edit_flag;

bool edit_mode;

public:		// User declarations
	__fastcall TadminForm(TComponent* Owner);
	void update_study_types_combo();
	void update_prepod_combo();
	void update_prepod_edits();
	void update_student_grid();
	void update_prepod_grid();
	void update_spec_grid_and_combo();
	void update_predmet_grid();
	void update_group_combo();
	void update_group_grid();
	void update_predmet_edits();
	void update_group_edits();
	void update_student_edits();


};
//---------------------------------------------------------------------------
extern PACKAGE TadminForm *adminForm;
//---------------------------------------------------------------------------
#endif
